package sfy.md.structure.theflyweight.demo;

import sfy.md.structure.theflyweight.StoreManager;

public class Connection extends ConnectionStore implements FlyWeightManager{

    public Connection(Boolean flag){
        if(flag){
            init(config);
        }
    }

    public Connection(){

    }


    @Override
    public StoreManager getStore() {

         return  this;

    }



    @Override
    public void init(Config config) {
        int size = config.getSize();
        for(int i=0;i<size;i++){
            list.add(new Connection());

        }
    }
}
